<?php
$selected=(isset($billid)&&!empty($billid));
if($selected)
{
	$selButCap = "Змінити";
}
else
{
	$selButCap = "Вибрати";
	$billname = "Не вибрано";
}
echo CHtml::tag('span',array("id"=>"billnameElement"),$billname);
echo "<br/>";
// the link that may open the dialog
echo CHtml::button($selButCap, array(
   'onclick'=>'$("#billsdialog").dialog("open"); return false;',
));

	echo CHtml::ajaxButton('Закрити', Chtml::normalizeUrl(array("products/processbill","action"=>"close","id"=>$billid)),array("update"=>"#currentbill"),array("id"=>"closebillbutton","name"=>"closebillbutton","disabled"=>!$selected));
	echo "<br />";
	echo CHtml::hiddenField('billid',$billid,array("id"=>"billidElement"));
	echo Chtml::textField('billpay',0,array('id'=>'billpay',"disabled"=>!$selected));



?>